<?php

namespace app\health\model\tracking;

use think\Model;

/**
 * 健康服务点击埋点模型
 * @Author 张旭鹏
 * @DateTime 2023-07-11
 */
class HealthTrackingHealth extends Model
{
    protected $name = 'health_tracking_health';

    public const TYPE_MAP = [
        1  => '在线问诊',
        3  => '挂号',
        4  => '重疾二诊',
        6  => '贴心陪诊',
        7  => '住院安排',
        9  => '营养师咨询',
        10 => '私教1v1',
    ];

    /**
     * 获取类型描述
     * @param [type] $val
     * @param [type] $data
     * @Author 张旭鹏
     * @DateTime 2023-07-11
     */
    public function getTypeTextAttr($val, $data): string
    {
        $type = $data['type'] ?? 0;
        return self::TYPE_MAP[$type] ?? '-';
    }
}
